define(["jquery","template","bld/template/drug/drugList.tpl"],function($,template,tpl) {
    var ui = {};

    var drawMedicineBigClass = function(data) {
        return template("tpl_drugList_medicineBigClass", data);
    }
    var drawMedicineSmallClass = function(data) {
        return template("tpl_drugList_medicineSmallClass", data);
    }
    var drawAddSmallClass = function(data) {
        return template("drugList_addSmallClass", data);
    }
    var drawAdd = function(data) {
        return template("drugList_add", data);
    }
    var drawSmallClass = function(data) {
        return template("drugList_smallClass", data);
    }
    var drawSelectCallBack = function(data) {
        return template("drugList_select", data);
    }

    ui.medicineBigClass = function(options) {
        $("#" + options.id).html(tpl.medicineBigClass());
        var h = drawMedicineBigClass(options);
        $("#" + options.id).html(h);
    }
    ui.medicineSmallClass = function(options) {
        $("#" + options.id).html(tpl.medicineSmallClass());
        var h = drawMedicineSmallClass(options);
        $("#" + options.id).html(h);
    }
    ui.addSmallClass = function(options) {
        options.dom.html(tpl.addSmallClass());
        var h = drawAddSmallClass(options);
        options.dom.html(h);
    }
    ui.add = function(options) {
        options.dom.html(tpl.add());
        var h = drawAdd(options);
        options.dom.html(h);
    }
    ui.smallClass = function(options) {
        $("#" + options.id).html(tpl.smallClass());
        var h = drawSmallClass(options);
        $("#" + options.id).html(h);
    }
    ui.selectCallBack = function(options) {
        $("#" + options.id).html(tpl.selectCallBack());
        var h = drawSelectCallBack(options);
        $("#" + options.id).html(h);
    }

    return ui;
});